package com.tte.common.producer.test;

/**
 * 创建消费者线程
 */
public class ConsumerThread extends Thread{
    private BufferBlock block;
    public ConsumerThread(BufferBlock block){
        this.block = block;
    }
    @Override
    public void run() {
        for(int i=0;i<10;i++){
            Food pop = this.block.pop();
            System.out.println("消费食物：" + pop.getId());
        }
    }
}
